const cookie = {
  set: function (key, value, day) {
    let date = new Date();
    date.setDate(date.getDate() + day);
    document.cookie = `${key}=${value};expires=${date};path=/`;
  },
  get: function (key) {
    let arr = document.cookie.split("; ");
    for (let value of arr) {
      let newarr = value.split("=");
      if (key === newarr[0]) {
        return newarr[1];
      }
    }
  },
  remove: function (key) {
    cookie.set(key, "", -1);
  },
};
export default cookie;
